﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace RadarMonitor.Converter
{
    class AlternativeConverter : IValueConverter
    {
        public object ValueForTure { get; set; }
        public object ValueForFalse { get; set; }

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            object result = ValueForTure;
            try
            {
                bool selected = (bool)value;
                if (!selected)
                {
                    result = ValueForFalse;
                }
            }
            finally
            {

            }

            return result;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }


    class AlternativeConverter_int : IValueConverter
    {
        public object ValueForTure { get; set; }
        public object ValueForFalse { get; set; }

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            object result = ValueForTure;
            try
            {
                int  selected = (int)value;
                if (selected==0)
                {
                    result = ValueForFalse;
                }
            }
            finally
            {

            }

            return result;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
